﻿@model FTBS.Models.Entities.User

@{
    ViewBag.Title = "Thêm nhà cung cấp";
    Layout = "~/Views/Shared/_AdminLayout.cshtml";
}

<legend style="margin-top: 10px">TẠO NHÀ CUNG CẤP</legend>

@using (Html.BeginForm("Create", "Supplier", null, FormMethod.Post,
                              new { enctype = "multipart/form-data"}))
{
    @Html.ValidationSummary(true)
    <table class="table striped bordered hovered" style="margin: 0px 0px 0px 0px;text-align: left;max-width: 750px">
        <tr>
            <th>Tên tài khoản (*)
            </th>
            <td>
                <div class="input-control text">
                    @Html.EditorFor(model => model.UserName)
                    <p style="color: red; font-size: 10pt">@Html.ValidationMessageFor(model => model.UserName)</p>
                    @if (ViewBag.UserName != null)
                    {
                        <p style="color: red; font-size: 10pt">Tài khoản đã tồn tại!</p>
                    }
                </div>
            </td>
        </tr>
        <tr>
            <th>Mật khẩu (*)
            </th>
            <td>
                <div class="input-control text">
                    @Html.PasswordFor(model => model.Password)
                    <p style="color: red; font-size: 10pt">@Html.ValidationMessageFor(model => model.Password)</p>
                </div>
            </td>
        </tr>
        <tr>
            <th>Tên nhà cung cấp (*)
            </th>
            <td>
                <div class="input-control text">
                    @Html.EditorFor(model => model.FullName)
                    <p style="color: red; font-size: 10pt">@Html.ValidationMessageFor(model => model.FullName)</p>
                </div>
            </td>
        </tr>
       <tr>
            <th>Địa chỉ (*)
            </th>
            <td>
                <div class="input-control text">
                    @Html.EditorFor(model => model.Address)
                    <p style="color: red; font-size: 10pt">@Html.ValidationMessageFor(model => model.Address)</p>
                </div>
            </td>
        </tr>
        <tr>
            <th>Email (*)
            </th>
            <td>
                <div class="input-control text">
                    @Html.EditorFor(model => model.Email)
                    <p style="color: red; font-size: 10pt">@Html.ValidationMessageFor(model => model.Email)</p>
                    @if (ViewBag.Email != null)
                    {
                        <p style="color: red; font-size: 10pt">Email này đã được sử dụng!</p>
                    }
                </div>
            </td>
        </tr>
        <tr>
            <th>Số điện thoại (*)
            </th>
            <td>
                <div class="input-control text">
                    @Html.EditorFor(model => model.PhoneNumber)
                    <p style="color: red; font-size: 10pt">@Html.ValidationMessageFor(model => model.PhoneNumber)</p>
                </div>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <div style="font-weight: bold">
                    @Html.LabelFor(model => model.ImageURL, "Hình ảnh")
                </div>
                <div class="input-control file info-state" data-role="input-control">
                    <input id="ImagePath" title="Upload a product image" type="file" name="file"/>
                    <input type="text" id="__input_file_wrapper__" readonly="" style="z-index: 1; cursor: default;">
                    <button class="btn-file" type="button" name="submit"></button>
                </div>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <div>
                    <input class="button info" type="submit" value="Lưu" style="text-align: center; width: 77px" />
                    <button class="button danger" style="float: right">
                        @Html.ActionLink("Quay Lại", "Index")
                    </button>
                </div>
            </td>
        </tr>
    </table>
}


